package com.moli.lumpSugar.user.controller;


import cn.hutool.core.collection.CollectionUtil;
import com.moli.lumpSugar.user.dao.BlackDao;
import com.moli.lumpSugar.user.domain.entity.Black;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 黑名单 前端控制器
 * </p>
 *
 * @author zhangjt
 * @since 2024-10-27
 */
@RestController
@RequestMapping("/sapi/black")
public class BlackController {
    @Autowired
    private BlackDao blackDao;

    @GetMapping("/getBlackList")
    public List<Black> getBlackList(){
        List<Black> list = blackDao.list();
        if (CollectionUtil.isNotEmpty(list)){
            return list;
        }else {
            return new ArrayList<>();
        }
    }

}

